﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebApplication1.WebForm1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="textmess"><h2>
    <asp:Label ID="welcome" runat="server" Text=""></asp:Label></h2><br />
       </div>
    <div id="home"><asp:Button ID="Logout" 
            runat="server" CausesValidation="False" onclick="Logout_Click" 
            Text="Logga ut" /></div>
    <div id="tabs">
       <ul>
           <li><a href="#tabs-1" title="Uppdatera din profil">Din profil</a></li>
           <li><a href="#tabs-2" title="Här bokar du tid för spel">Boka spel</a></li>
           <li><a href="#tabs-3" title="Här avbokar du spel">Avboka spel</a></li>
           <li><a href="#tabs-4" title="Här anmäler/avanmäler du dig till tävling">Tävling</a></li>
       </ul>
       <div id="tabs-1">
       <div id="update_form">
           <asp:Label ID="Label1" runat="server" Text="Förnamn"></asp:Label>
           <br />
           <asp:TextBox ID="First_name" runat="server"></asp:TextBox><asp:RegularExpressionValidator
               ID="RegularExpressionValidator1" runat="server" CssClass="firstname" ErrorMessage="Förnamnet får endast bestå av bokstäver" ValidationExpression="^[a-zåäöA-ZÅÄÖ0''-'\s]{1,40}$" ControlToValidate="First_name" SetFocusOnError="True" Display="Dynamic"></asp:RegularExpressionValidator><asp:RequiredFieldValidator
                   ID="RequiredFieldValidator1" runat="server" CssClass="firstname" ErrorMessage="Du måste fylla i ett förnamn" ControlToValidate="First_name" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
           <br />
           <br />
           <asp:Label ID="Label2" runat="server" Text="Efternamn"></asp:Label>
           <br />
           <asp:TextBox ID="Last_name" runat="server"></asp:TextBox><asp:RegularExpressionValidator
               ID="RegularExpressionValidator2" runat="server" CssClass="lastname" ErrorMessage="Efternamnet får endast bestå av bokstäver" ValidationExpression="^[a-zåäöA-ZÅÄÖ0''-'\s]{1,40}$" ControlToValidate="Last_name" SetFocusOnError="True" Display="Dynamic"></asp:RegularExpressionValidator><asp:RequiredFieldValidator
                   ID="RequiredFieldValidator2" runat="server" CssClass="lastname" ErrorMessage="Du måste fylla i ett efternamn" ControlToValidate="Last_name" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
           <br />
           <br />
           <asp:Label ID="Label3" runat="server" Text="Telefon"></asp:Label>
           <br />
           <asp:TextBox ID="Phone" runat="server"></asp:TextBox><asp:RegularExpressionValidator
               ID="RegularExpressionValidator3" runat="server"  CssClass="phone" ErrorMessage="Telefonnummer ska bestå av siffror och börja med 46 (Sverige). Du tar bort nollan som startar ditt riktnummer, samt lägger till slutnummer. Ex. 4683123456" ControlToValidate="Phone" ValidationExpression="^46[1-9][0-9]{0,2}[0-9]{5,8}" SetFocusOnError="True" Display="Dynamic"></asp:RegularExpressionValidator>
           <br />
           <br />
           <asp:Label ID="Label4" runat="server" Text="E-postadress"></asp:Label>
           <br />
           <asp:TextBox ID="E_mail" runat="server"></asp:TextBox><asp:RegularExpressionValidator
               ID="RegularExpressionValidator4" runat="server"  CssClass="email" ErrorMessage="Den epostadress du fyllt i är inte korrekt" ControlToValidate="E_mail" ValidationExpression="^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$" SetFocusOnError="True"></asp:RegularExpressionValidator>
           <br />
           <br />
           <asp:Label ID="Label5" runat="server" Text="Handicap"></asp:Label>
           <br />
           <asp:TextBox ID="Handicap" runat="server"></asp:TextBox><asp:RangeValidator ID="RangeValidator1"
               runat="server"  CssClass="handicap" ErrorMessage="Ditt handicap måste vara ett värde mellan 1 och 100" ControlToValidate="Handicap" Type="Integer" MinimumValue="1" MaximumValue="100" SetFocusOnError="True"></asp:RangeValidator>
           <br />
           <br />
           <asp:Label ID="Label12" runat="server" Text="Nytt lösenord"></asp:Label>
           <br />
           <asp:TextBox ID="newPasswordBox" runat="server" TextMode="Password"></asp:TextBox>
           <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server"  CssClass="newpassword" ErrorMessage="Lösenordet får ej bestå av specialtecken, endast bokstäver och siffror" ControlToValidate="newPassWordBox" ValidationExpression="^[a-zåäöA-ZÅÄÖ0-9_\s]{5,50}$" SetFocusOnError="True"></asp:RegularExpressionValidator>
           <br />
           <br />
           <asp:Label ID="Label11" runat="server" Text="Repetera lösenord"></asp:Label>
           <br />
           <asp:TextBox ID="repeatPasswordBox" runat="server" TextMode="Password"></asp:TextBox>
           <asp:CompareValidator ID="CompareValidator1"  CssClass="repeatpassword" runat="server" ErrorMessage="Nytt lösenord och repetera lösenord stämmer inte överrens, prova igen" ControlToCompare="newPassWordBox" ControlToValidate="repeatPassWordBox" SetFocusOnError="True"></asp:CompareValidator>
           <br />
           <br />
           <asp:Button ID="Update_user" runat="server" Text="Uppdatera" Width="150px" OnClick="Update_user_Click1" />
           <br />
           </div>
       </div>
       <div id="tabs-2">
            <asp:Label ID="MeddelandeLabel" runat="server" Text=""></asp:Label>

            <asp:Calendar ID="Datum" runat="server" 
                onselectionchanged="Datum_SelectionChanged"></asp:Calendar>
            <asp:DropDownList ID="Tider" runat="server" Visible="False" 
                onselectedindexchanged="Tider_SelectedIndexChanged">
            </asp:DropDownList><br />
            <asp:Button ID="bokaspel" runat="server" Text="Boka tid" 
                onclick="bokaspel_Click" Visible="False" CausesValidation="False" />
            <asp:Label ID="test" runat="server"></asp:Label><asp:Label ID="senastBokadTid" runat="server"
                Text=""></asp:Label>
            <br /><br />
            <asp:Label ID="SällskapLabel" runat="server" Text="Boka sällskap på din bokade tid: " 
                Visible="False"></asp:Label><br />
            <asp:DropDownList ID="Sällskap1" runat="server" Visible="False">
            </asp:DropDownList><br />
            <asp:DropDownList ID="Sällskap2" runat="server" Visible="False">
            </asp:DropDownList><br />
            <asp:DropDownList ID="Sällskap3" runat="server" Visible="False">
            </asp:DropDownList>
            <br />
            <asp:Button ID="bokasällskap" runat="server" Text="Boka sällskap" 
                onclick="bokasällskap_Click" Visible="False" CausesValidation="False" /><asp:Label
                    ID="sällskapsinfo" runat="server" Text=""></asp:Label>
            <br />
       </div>
       <div id="tabs-3">
           <p>
               <asp:Label ID="LabelBokadeTider" runat="server" Text="Bokade Spel:"></asp:Label><br />
               <asp:DropDownList ID="BokadeTider" runat="server">
               </asp:DropDownList>
               <asp:Button ID="Avboka" runat="server" Text="Avboka tid" 
                   CausesValidation="False" onclick="Avboka_Click" />
           </p>
       </div>
       <div id="tabs-4">
               <h2><asp:Label ID="Label8" runat="server" Text="Du är anmäld till följande tävlingar:"></asp:Label></h2>
               <asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" Width="500px" AutoGenerateDeleteButton="True" OnRowDeleting="GridView1_RowDeleting">
                   <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                   <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                   <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                   <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                   <SortedAscendingCellStyle BackColor="#F7F7F7" />
                   <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                   <SortedDescendingCellStyle BackColor="#E5E5E5" />
                   <SortedDescendingHeaderStyle BackColor="#242121" />
               </asp:GridView>
               <br />
           <br />
               <h2><asp:Label ID="Label9" runat="server" Text="Kommande tävlingar:"></asp:Label></h2>
               <asp:GridView ID="GridView2" runat="server" BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Horizontal" Width="500px" AutoGenerateSelectButton="True" OnSelectedIndexChanged="GridView2_SelectedIndexChanged">
                   <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
                   <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
                   <PagerStyle BackColor="White" ForeColor="Black" HorizontalAlign="Right" />
                   <SelectedRowStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
                   <SortedAscendingCellStyle BackColor="#F7F7F7" />
                   <SortedAscendingHeaderStyle BackColor="#4B4B4B" />
                   <SortedDescendingCellStyle BackColor="#E5E5E5" />
                   <SortedDescendingHeaderStyle BackColor="#242121" />
               </asp:GridView>
           
           <p>
               &nbsp;</p>
       </div>
   </div>



</asp:Content>